package com.shangguosha.core.event;

import com.shangguosha.model.Character;
import com.shangguosha.model.enums.DamageType;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 伤害相关事件
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DamageEvent extends GameEvent {
    private Character source;
    private Character target;
    private int damage;
    private DamageType damageType;
    private Object data;
    
    public DamageEvent(String eventType, Object eventSource, Character source, Character target, int damage) {
        super(eventType, eventSource);
        this.source = source;
        this.target = target;
        this.damage = damage;
        this.damageType = DamageType.NORMAL;
    }
    
    public DamageEvent(String eventType, Object eventSource, Character source, Character target, int damage, DamageType damageType) {
        super(eventType, eventSource);
        this.source = source;
        this.target = target;
        this.damage = damage;
        this.damageType = damageType;
    }
    
    public DamageEvent(String eventType, Object eventSource, Character source, Character target, int damage, DamageType damageType, Object data) {
        super(eventType, eventSource);
        this.source = source;
        this.target = target;
        this.damage = damage;
        this.damageType = damageType;
        this.data = data;
    }
}